<template>
	<el-form>
		<el-form-item label-width="120px" label="复制次数">
			<el-input width="120px" type="textarea" v-model="times" placeholder="复制次数"></el-input>
		</el-form-item>

		<el-form-item class="btnDir">
			<el-button @click="onSubmit">确 定</el-button>
			<el-button @click="onCancel">取 消</el-button>
		</el-form-item>
	</el-form>
</template>

<script>
import requestUtil from "@/utils/requestEnc";
import OrderService from "@/api/order/OrderService";
import { mapState } from "vuex";
export default {
	components: {
		requestUtil,
		OrderService,
	},
	computed: {
		...mapState("orders", ["orderItemList"]),
		...mapState("user", ["user"]),
	},
	async mounted() {},
	watch: {},
	props: {
		ODKInfo: {
			type: Object,
			default: () => {
				return {};
			},
		},
		CTOInfo: {
			type: Array,
			default: () => {
				return [];
			},
		},
	},
	data() {
		return {
			reFee: "",
			valueRadio: "",
			orderTask: {},
			orderItemIds: "",
			times: "",
		};
	},
	methods: {
		onCancel() {
			this.$emit("update:show", false);
		},
		async onSubmit() {
			var reqMap = this.ODKInfo.reqMap;
			reqMap.times = this.times;
			

			var result = await OrderService.doCopyOrder(reqMap);

			
			if (result.code == 200) {
				this.$confirm("复制成功", "提示", {
					confirmButtonText: "确定",
					showCancelButton: false,
					type: "success",
					center: true,
				});
			} else {
				this.$confirm(result.meta, "提示", {
					confirmButtonText: "确定",
					showCancelButton: false,
					type: "warn",
					center: true,
				});
			}
			this.$emit("close");
		},
	},
};
</script>

<style>
.el-form--inline .el-form-item {
	display: inline-flex;
	margin-right: 0.1rem;
	vertical-align: top;
	width: 42%;
}

.el-form-item__label {
	width: 94px;
}
.btnDir {
	margin-left: 36%;
	margin-top: 19px;
}
</style>
